package com.mnxiaotu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mnxiaotu.entity.Role;
import com.mnxiaotu.entity.User;
import com.mnxiaotu.service.RoleService;
import com.mnxiaotu.mapper.RoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86182
* @description 针对表【role(角色表)】的数据库操作Service实现
* @createDate 2024-04-25 23:58:41
*/
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role>
    implements RoleService{

    @Autowired
    RoleMapper roleMapper;

    @Override
    public Role getByRolename(String rolename) {
        return getOne(new QueryWrapper<Role>().eq("rolename",rolename));
    }

    @Override
    public void deleteByIds(List<Long> idList) {
        for(long id : idList){
            roleMapper.deleteById(id);
        }
    }
}




